package com.lc.user.express.ordering;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.lc.user.express.R;
import com.lc.user.express.app.AppContext;



/**
 * Created by Administrator on 2016/8/23.
 */
public class JiaJuwxActivity extends Activity implements View.OnClickListener {

    private TextView open_wx;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_jiajuwx);
        initviews();
    }

    private void initviews() {
        open_wx = (TextView) findViewById(R.id.open_wx);

        open_wx.setOnClickListener(this);

    }
    @Override
    public void setContentView(int layoutResID) {
        super.setContentView(layoutResID);
        ViewGroup viewGroup = (ViewGroup) getWindow().getDecorView();
        AppContext.ScaleScreenHelper.loadView(viewGroup);
    }
    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.open_wx:
                Intent intent = new Intent();
                ComponentName cmp = new ComponentName("com.tencent.mm","com.tencent.mm.ui.LauncherUI");
                intent.setAction(Intent.ACTION_MAIN);
                intent.addCategory(Intent.CATEGORY_LAUNCHER);
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                intent.setComponent(cmp);
                startActivityForResult(intent, 0);
                break;
        }
    }


}
